package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appmarket.service.store.awk.card.HorizontalSmallEntranceCard;
import com.huawei.appmarket.service.store.awk.widget.horizon.BaseHorizonCard;
import o.cdr;
import o.cgz;
import o.chy;
import o.chz;
import o.ewm.h;
import org.jetbrains.annotations.NotNull;

public class HorizontalSmallEntranceNode extends cdr {
    private LayoutInflater ˊ;
    private BaseHorizonCard ᐝ;

    public HorizontalSmallEntranceNode(Context context) {
        super(context, 1);
        this.ˊ = LayoutInflater.from(context);
    }

    public int ˏ() {
        return 1;
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        View ˋ = ˋ();
        this.ᐝ = ˎ();
        this.ᐝ.ˏ(ˋ);
        ˊ(this.ᐝ);
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
        layoutParams.weight = 1.0f;
        viewGroup.addView(ˋ, layoutParams);
        return true;
    }

    @NotNull
    protected HorizontalSmallEntranceCard ˎ() {
        return new HorizontalSmallEntranceCard(this.ॱ);
    }

    private LinearLayout ˋ() {
        return (LinearLayout) this.ˊ.inflate(h.ߵॱ, null);
    }

    public boolean ॱ(chz o_chz, ViewGroup viewGroup) {
        if (this.ᐝ != null) {
            this.ᐝ.ˊ(o_chz, ͺ());
        }
        return super.ॱ(o_chz, viewGroup);
    }

    public void ˋ(chy o_chy) {
        int i = 0;
        while (i < ˊॱ()) {
            cgz ˊ = ˊ(i);
            if (ˊ instanceof HorizontalSmallEntranceCard) {
                ((HorizontalSmallEntranceCard) ˊ).ˊ(o_chy);
                i++;
            } else {
                return;
            }
        }
    }
}
